package cn.ml.duoXianCheng.threadDemo;

/**
 * 集成Thread类的方式创建线程
 */
public class XianChengDemo2 extends Thread{
    @Override
    public void run() {
        for (int i=0;i<100;i++) {
            System.out.println(Thread.currentThread().getName() +"___"+ i);
        }
    }

    public static void main(String[] args) {
        XianChengDemo2 t1 = new XianChengDemo2();
        XianChengDemo2 t2 = new XianChengDemo2();
        t1.start();
        t2.start();
        //t1.run();//1.只有主线程一条执行路径  2.一次调用了两次run()方法
        //t2.run();


    }


}
